package bean.user;

import dao.user.UserDAO;
import entity.user.User;

import java.util.List;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.inject.Inject;

@ManagedBean
@ViewScoped
public class UserListBean {
	
	@Inject
	private UserDAO userDAO;
	
	private List<User> userList;	
	
	public List<User> loadAllUsers() {
		return userDAO.findByCriteria();
	}

	public List<User> getUserList() {
		userList = userDAO.findByCriteria();
		return userList;
	}
	
	public void setUserList(List<User> userList) {
		this.userList = userList;
	}

}

